﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using HigLabo.WindowsAzure.RestService.Extensions;

namespace HigLabo.WindowsAzure.RestService.ServiceManagement
{
    public class InputEndpoint
    {
        public static readonly String ElementName = "InputEndpoint"; 
        
        public String RoleName { get; private set; }
        public String Vip { get; private set; }
        public Int32 Port { get; private set; }

        public InputEndpoint(XElement xml)
        {
            if (xml == null)
            {
                throw new ArgumentNullException("xml");
            }
            this.RoleName = xml.ValueOrEmpty("RoleName");
            this.Vip = xml.ValueOrEmpty("Vip");
            this.Port = xml.ValueToInt32("Port",0);
        }

    }
}
